<?php
/**
 * Controller is the customized base controller class.
 * All controller classes for this application should extend from this base class.
 */
class BlankController extends CController
{
    public $layout = "none";
    public $data = array();
    public $connection = null;

    public function init()
    {
        parent::init();
        $this->connection = Yii::app()->db;
    }

    public function run($actionID)
    {
        $transaction=$this->connection->beginTransaction();
        try{

            if(($action=$this->createAction($actionID))!==null)
            {
                if(($parent=$this->getModule())===null)
                    $parent=Yii::app();
                if($parent->beforeControllerAction($this,$action))
                {
                    $this->runActionWithFilters($action,$this->filters());
                    $parent->afterControllerAction($this,$action);
                }
            }
            else
                $this->missingAction($actionID);

            $transaction->commit();
        }catch (Exception $e){
            $transaction->rollback();
        }
    }

}